﻿/**
 * @author sminutoli
 */
import com.dinmax.flash.central.CENTRAL
import com.dinmax.flash.draw.cabeza.*
import com.dinmax.flash.central.action.*
import com.dinmax.flash.central.communication.Communication

class com.dinmax.flash.central.bridge.MAKECALLBridge
extends ControlCabeza
implements SelectedListener {
	
	private var mcPhoneField:FieldCabeza;
	private var mcAccept:ButtonCabeza;
	
	public function initChild(control:ControlCabeza):Void {
		control.addListener(this);
		switch(control){
			case this.mcPhoneField:
			FieldCabeza(control).setLabel("Telefono");
			FieldCabeza(control).setValue("");
			FieldCabeza(control).getField().restrict = "0-9";
			
			break;
						
		};	
		return;
	};
	
	public function selected(control:ControlCabeza):Void {
		switch(control){
			case this.mcAccept:
			CENTRAL.getActive().outgoingCall(Number(mcPhoneField.getValue()));
			this.selectEvent();
			break;
		};
		return;
	};
	
}